package com.thinkingstar.iads.projectcenter.entity.dao;

import com.thinkingstar.iads.common.serviceImpl.EntityRepositoryServiceImpl;
import com.thinkingstar.iads.projectcenter.entity.PcTczlFile;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.sql.Criteria;
import org.nutz.ioc.loader.annotation.IocBean;

import java.util.List;


/**
 * @ClassName: DaoPcTczlFile
 * @Description:提出资料文件
 * @author z
 */
@IocBean(args = {"refer:dao"})
public class DaoPcTczlFile extends EntityRepositoryServiceImpl<PcTczlFile>{

    public DaoPcTczlFile(Dao dao) {
        super(dao);
    }

    public PcTczlFile findByProjectAndFileNum(String project_id,String fileNum) {
        Criteria cri = Cnd.NEW();
        cri.where().and("project_id", "=", project_id).and("fileNum","=",fileNum);
        List<PcTczlFile> list = dao().query(PcTczlFile.class, cri);
        if (list.size()>0) {
            return list.get(0);
        } else {
            return null;
        }
    }
}
